bb87ccef9e1d03eef31c203d0c183e9e3d580858,src/org/jgroups/protocols/MPING.java,MPING,start,#,96

Before Change


        mcast_sock=new MulticastSocket(mcast_port);
        mcast_sock.setTimeToLive(ip_ttl);
        if(bind_addr != null)
            mcast_sock.setInterface(bind_addr);
        mcast_sock.joinGroup(mcast_addr);
        startReceiver();
        super.start();

After Change


        mcast_sock=new MulticastSocket(mcast_port);
        mcast_sock.setTimeToLive(ip_ttl);

        if(bind_to_all_interfaces && jdk_version >= 14) {
            bindToAllInterfaces();
        }
        else {
            if(bind_addr == null) {
                InetAddress[] interfaces=InetAddress.getAllByName(InetAddress.getLocalHost().getHostAddress());
                if(interfaces != null && interfaces.length > 0)
                    bind_addr=interfaces[0];
            }
            if(bind_addr == null)
                bind_addr=InetAddress.getLocalHost();

            if(bind_addr != null)
                if(log.isInfoEnabled()) log.info("sockets will use interface " + bind_addr.getHostAddress());


            if(bind_addr != null) {
                mcast_sock.setInterface(bind_addr);
                // mcast_sock.setNetworkInterface(NetworkInterface.getByInetAddress(bind_addr)); // JDK 1.4 specific
            }
            mcast_sock.joinGroup(mcast_addr);